home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / misc1 / iv26_w30.zip / INTERVIE / ADJUSTER.H next >
C/C++ Source or Header  |  1980-01-03  |  4KB  |  150 lines

  1. /*
  2.  * Copyright (c) 1987, 1988, 1989 Stanford University
  3.  *
  4.  * Permission to use, copy, modify, distribute, and sell this software and its
  5.  * documentation for any purpose is hereby granted without fee, provided
  6.  * that the above copyright notice appear in all copies and that both that
  7.  * copyright notice and this permission notice appear in supporting
  8.  * documentation, and that the name of Stanford not be used in advertising or
  9.  * publicity pertaining to distribution of the software without specific,
  10.  * written prior permission.  Stanford makes no representations about
  11.  * the suitability of this software for any purpose.  It is provided "as is"
  12.  * without express or implied warranty.
  13.  *
  14.  * STANFORD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  15.  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
  16.  * IN NO EVENT SHALL STANFORD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  17.  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  18.  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  19.  * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
  20.  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  21.  */
  22.  
  23. /*
  24.  * Adjuster - button-like interactors for incremental adjustment of an
  25.  * interactor's perspective.
  26.  */
  27.  
  28. #ifndef adjuster_h
  29. #define adjuster_h
  30.  
  31. #include <InterViews/interactor.h>
  32.  
  33. static const int NO_AUTOREPEAT = -1;
  34.  
  35. class Bitmap;
  36. class Shape;
  37.  
  38. class Adjuster : public Interactor {
  39. public:
  40.     Adjuster(Interactor*, int = NO_AUTOREPEAT);
  41.     Adjuster(const char*, Interactor*, int = NO_AUTOREPEAT);
  42.     Adjuster(Interactor*, int, Painter*);
  43.     ~Adjuster();
  44.  
  45.     void Handle(Event&);
  46.     virtual void Highlight(boolean on);
  47.     void Redraw(Coord, Coord, Coord, Coord);
  48.     void Reshape(Shape&);
  49. protected:
  50.     Interactor* view;
  51.     Bitmap* plain;
  52.     Bitmap* hit;
  53.     Bitmap* mask;
  54.     int delay;
  55.     Perspective* shown;
  56.     boolean highlighted;
  57.  
  58.     virtual void AdjustView(Event&);
  59.     void AutoRepeat();
  60.     void Flash();
  61.     void HandlePress();
  62.     void Invert();
  63.     virtual void Reconfig();
  64.     void TimerOn();
  65.     void TimerOff();
  66. private:
  67.     void Init(Interactor*, int);
  68. };
  69.  
  70. class Zoomer : public Adjuster {
  71. public:
  72.     Zoomer(Interactor*, float factor);
  73.     Zoomer(const char*, Interactor*, float factor);
  74.     Zoomer(Interactor*, float factor, Painter*);
  75. protected:
  76.     void AdjustView(Event&);
  77. private:
  78.     float factor;
  79.  
  80.     void Init(float);
  81. };
  82.  
  83. class Enlarger : public Zoomer {
  84. public:
  85.     Enlarger(Interactor*);
  86.     Enlarger(const char*, Interactor*);
  87.     Enlarger(Interactor*, Painter*);
  88. private:
  89.     void Init();
  90. };
  91.  
  92. class Reducer : public Zoomer {
  93. public:
  94.     Reducer(Interactor*);
  95.     Reducer(const char*, Interactor*);
  96.     Reducer(Interactor*, Painter*);
  97. private:
  98.     void Init();
  99. };
  100.  
  101. class Mover : public Adjuster {
  102. public:
  103.     Mover(Interactor*, int delay, int moveType);
  104.     Mover(const char*, Interactor*, int delay, int moveType);
  105.     Mover(Interactor*, int delay, int moveType, Painter*);
  106. protected:
  107.     int moveType;
  108.     void AdjustView(Event&);
  109. private:
  110.     void Init(int);
  111. };
  112.  
  113. class LeftMover : public Mover {
  114. public:
  115.     LeftMover(Interactor*, int delay = NO_AUTOREPEAT);
  116.     LeftMover(const char*, Interactor*, int delay = NO_AUTOREPEAT);
  117.     LeftMover(Interactor*, int delay, Painter*);
  118. private:
  119.     void Init();
  120. };
  121.  
  122. class RightMover : public Mover {
  123. public:
  124.     RightMover(Interactor*, int delay = NO_AUTOREPEAT);
  125.     RightMover(const char*, Interactor*, int delay = NO_AUTOREPEAT);
  126.     RightMover(Interactor*, int delay, Painter*);
  127. private:
  128.     void Init();
  129. };
  130.  
  131. class UpMover : public Mover {
  132. public:
  133.     UpMover(Interactor*, int delay = NO_AUTOREPEAT);
  134.     UpMover(const char*, Interactor*, int delay = NO_AUTOREPEAT);
  135.     UpMover(Interactor*, int delay, Painter*);
  136. private:
  137.     void Init();
  138. };
  139.  
  140. class DownMover : public Mover {
  141. public:
  142.     DownMover(Interactor*, int delay = NO_AUTOREPEAT);
  143.     DownMover(const char*, Interactor*, int delay = NO_AUTOREPEAT);
  144.     DownMover(Interactor*, int delay, Painter*);
  145. private:
  146.     void Init();
  147. };
  148.  
  149. #endif
  150.